package com.etc.service.impl;/*
 * 文件名：com.etc.service.impl
 * 描述：
 * 作者：蒋丽娟
 * 时间：2019/5/29 18:53
 */

import com.etc.dao.OrdersDao;
import com.etc.entity.Orders;
import com.etc.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrdersDao ordersDao;
    @Override
    public Boolean insertSelective ( Orders orders ) {
        return  ordersDao.insertSelective(orders)>0;
    }

    @Override
    public Orders selectByOrderNum ( String ordernum ) {
        return ordersDao.selectByOrderNum(ordernum);
    }

    @Override
    public List<Orders> listOrdersList() {
        return ordersDao.listOrdersList();
    }

    @Override
    public Orders getOrdersByOrderid(Integer orderid) {
        return ordersDao.getOrdersByOrderid(orderid);
    }

    @Override
    public List<Orders> listOrdersListBypage(Integer page, Integer limit) {
        Integer start = (page-1) * limit;
        return ordersDao.listOrdersListBypage(start,limit);
    }

    @Override
    public Integer getcount() {
        return ordersDao.getcount();
    }

    @Override
    public boolean updateOrderByOrderid(Integer orderid) {
        return ordersDao.updateOrderByOrderid2(orderid);
    }
}
